import request from "../utils/request.js";
const PREFIX = "/admin/video"

export default {
    pageQueryVideoList(queryDto){
        return request({
            url: `${PREFIX}/page/list`,
            method:'post',
            data:queryDto
        })
    },
    getVideoInfo(code){
        return request({
            url:`${PREFIX}/info/${code}`,
            method:'get'
        })
    },
    publishVideo(dto){
        return request({
            url:`${PREFIX}/publish`,
            method:'post',
            data:dto
        })
    },
    updateVideo(dto){
        return request({
            url:`${PREFIX}/update`,
            method:'post',
            data:dto
        })
    },
    uploadVideo(formData){
        return request({
            url:`${PREFIX}/upload`,
            method:'post',
            params:formData,
            transformRequest:[function (data, headers){
                delete headers['Content-Type']
                return data
            }],
            data:formData
        })
    },
    mergeVideoFile(mergeDto){
        return request({
            url:`${PREFIX}/merge`,
            method:'post',
            data:mergeDto
        })
    },
    checkVideoSourceIsExist(dto){
        return request({
            url:`${PREFIX}/exist`,
            method:'post',
            data:dto
        })
    }
}